<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"><!--<![endif]-->
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title><g:layoutTitle default="Grails"/></title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link rel="shortcut icon" href="${resource(dir: 'images', file: 'favicon.ico')}" type="image/x-icon">
		<link rel="apple-touch-icon" href="${resource(dir: 'images', file: 'apple-touch-icon.png')}">
		<link rel="apple-touch-icon" sizes="114x114" href="${resource(dir: 'images', file: 'apple-touch-icon-retina.png')}">
		<link rel="stylesheet" href="${resource(dir: 'css', file: 'main.css')}" type="text/css">
		<link rel="stylesheet" href="${resource(dir: 'css', file: 'tags.css')}" type="text/css">
		<link rel="stylesheet" href="${resource(dir: 'css/question', file: 'show.css')}" type="text/css">
		<link rel="stylesheet" href="${resource(dir: 'css/question', file: 'list.css')}" type="text/css">
		<link rel="stylesheet" href="${resource(dir: 'css/tags', file: 'list.css')}" type="text/css">
		<link rel="stylesheet" href="${resource(dir: 'css/author', file: 'list.css')}" type="text/css">
		<link rel="stylesheet" href="${resource(dir: 'css', file: 'mobile.css')}" type="text/css">
		<g:javascript library="jquery" plugin="jquery"/>
		<g:layoutHead/>
		<r:layoutResources />
		<ckeditor:resources />
	</head>
	<body>
		<div id="grailsLogo" role="banner">
			<a href="${createLink(controller:'question')}">
				<img src="${resource(dir: 'images', file: 'grails_logo.png')}" alt="Grails"/>
			</a>
			<div id="login-info">
				<g:set var="author" value="${session.author}" />
				<g:if test="${author}">
						<g:message code="default.header.loggedAs" />
						<g:link controller="author" action="show" id="${author.id}">${author.pseudo}<g:if test="${author.admin}"><g:message code="default.header.admin" /></g:if></g:link><br /><br />
						<g:link controller="author" action="doLogout" params="${['lastUri': (request.forwardURI - request.contextPath)]}"><g:message code="default.header.logOut" /></g:link>
				</g:if>
				<g:else>
					<g:message code="default.header.notLogged" /><br /><br />
					<g:link controller="author" action="login" params="${['lastUri': (request.forwardURI - request.contextPath)]}" >
						<g:message code="default.header.logIn" />
					</g:link>
					 | 
					<g:link controller="author" action="create" params="${['lastUri': (request.forwardURI - request.contextPath)]}" >
						<g:message code="default.header.signUp" />
					</g:link>
				</g:else>
			</div>
			<g:set var="flagClass" value="notSelectedLocaleFlag"/>
			<g:if test="${session.'org.springframework.web.servlet.i18n.SessionLocaleResolver.LOCALE'.toString().startsWith('en')}">
				<g:set var="flagClass" value="selectedLocaleFlag"/>
			</g:if>
			<g:link class="${flagClass}" controller="author" action="changeLocale" params="${['baseLocale':'en', 'localeExtension':'US', 'lastUri': (request.forwardURI - request.contextPath)]}" >
				<img src="${resource(dir:'images', file:'gb.gif') }" />
			</g:link>
			<g:set var="flagClass" value="notSelectedLocaleFlag"/>
			<g:if test="${session.'org.springframework.web.servlet.i18n.SessionLocaleResolver.LOCALE'.toString().startsWith('fr')}">
				<g:set var="flagClass" value="selectedLocaleFlag"/>
			</g:if>
			<g:link class="${flagClass}" controller="author" action="changeLocale" params="${['baseLocale':'fr', 'localeExtension':'FR', 'lastUri': (request.forwardURI - request.contextPath)]}" >
				<img src="${resource(dir:'images', file:'fr.gif') }"/>
			</g:link>
		</div>
		<div id="menu">

			<g:link controller="question" action="list"  class="${params.controller == "question"?"selected":""}"><g:message code="default.header.questions" /></g:link>
			<g:link controller="tag" class="${params.controller == "tag"?"selected":""}"><g:message code="default.header.tags" /></g:link>
			<g:link controller="author" class="${params.controller == "author"?"selected":""}"><g:message code="default.header.users" /></g:link>
			<g:link controller="question" action="create" class="${(params.controller == 'question' && params.action == 'create')?'ask-question selected':'ask-question'}"><g:message code="default.header.ask" /></g:link>
		</div>
		<g:layoutBody/>
		<!--  
		<div class="footer" role="contentinfo"></div>
		-->
		<div id="spinner" class="spinner" style="display:none;"><g:message code="spinner.alt" default="Loading&hellip;"/></div>
		<g:javascript library="application"/>
		<r:layoutResources />
	</body>
</html>
